using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class drug_typeMap : EntityTypeConfiguration<drug_type>
    {
        public drug_typeMap()
        {
            // Primary Key
            this.HasKey(t => t.drug_type_id);

            // Properties
            this.Property(t => t.drug_type_name)
                .HasMaxLength(20);

            this.Property(t => t.compliant_symptom)
                .HasMaxLength(80);

            this.Property(t => t.constraint_compelling)
                .HasMaxLength(80);

            this.Property(t => t.constraint_possible)
                .HasMaxLength(80);

            this.Property(t => t.bad_consequence)
                .HasMaxLength(80);

            // Table & Column Mappings
            this.ToTable("drug_type");
            this.Property(t => t.drug_type_id).HasColumnName("drug_type_id");
            this.Property(t => t.drug_type_name).HasColumnName("drug_type_name");
            this.Property(t => t.compliant_symptom).HasColumnName("compliant_symptom");
            this.Property(t => t.constraint_compelling).HasColumnName("constraint_compelling");
            this.Property(t => t.constraint_possible).HasColumnName("constraint_possible");
            this.Property(t => t.bad_consequence).HasColumnName("bad_consequence");
        }
    }
}
